package com.example.shixunandjavagotoyangchen.BoosYang.Day005.SwimErweima;

import androidx.appcompat.app.AppCompatActivity;

import android.Manifest;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Bundle;
import android.widget.ImageView;

import com.example.modelviewpresenter.View.BasterActivity;
import com.example.shixunandjavagotoyangchen.R;
import com.uuzuche.lib_zxing.activity.CodeUtils;

public class GoatActivity extends BasterActivity {


    private android.widget.ImageView GoatImg;

    @Override
    public int BandLayout() {
        return R.layout.activity_goat;
    }

    @Override
    public void initView() {

        GoatImg = (ImageView) findViewById(R.id.GoatImg);
    }

    @Override
    public void initDate() {

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            requestPermissions(new String[]{Manifest.permission.CAMERA,Manifest.permission.VIBRATE,Manifest.permission.WRITE_EXTERNAL_STORAGE}, 200);
        }


            Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.imger_touxiang);
            Bitmap code = CodeUtils.createImage("杨浩鑫不会的二维码", 400, 400, bitmap);
            GoatImg.setImageBitmap(code);

    }
}
